<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
    // 1.创建对象,并设置初始值.
    var person={
        name:"喜羊羊",
        sex:"男",
        age:"18",
        address:"羊村",
        run(){
            console.log("我灰太狼还会回来的!!!");
        }
    }

    // 2.动态添加新属性
    person["height"]=150;

    // 3.查看信息
    console.log(person.name);
    console.log(person);
    // 调用
    person.run();

    for(var key in person){
        console.log(key,perdon(key));
    }
    </script>
</body>
</html>